import { defineStore } from 'pinia'

import { watch, ref, reactive, computed } from 'vue'

export const useMusicListStore = defineStore('MusicListStore', () => {
  console.log('import.meta.env.VITE_BASE_URL', import.meta.env)

  const state = reactive({
    // musicUrl: `/src/assets/audio/我在你眼里到底算什么 (DJR7版) - 王恰恰.mp3`, // 用户当前播放器播放的音乐url
    musicList: [] as musicListItemType[]
  })

  function setMusicList(list: any) {
    state.musicList = list
    console.log('本地音乐列表', state.musicList)
  }

  return {
    musicList: computed(() => state.musicList),
    setMusicList
  }
})
